vim.g.mapleader = ";"

local function mapkey(mode, lhs, rhs)
	vim.api.nvim_set_keymap(mode, lhs, rhs, {noremap=true})
end

local function mapcmd(key, cmd)
	vim.api.nvim_set_keymap('n', key, ':'..cmd..'<CR>', {noremap=true})
end

-- mapkey('n', '<A-m>', ':NvimTreeToggle<CR>')

-- f: file tree
mapcmd('<leader>ft', 'NvimTreeToggle')
mapcmd('<leader>ff', 'NvimTreeFocus')

-- y: telescope
mapcmd('<leader>yo', 'Telescope find_files')
mapcmd('<leader>yg', 'Telescope live_grep')
mapcmd('<leader>yb', 'Telescope buffers')

-- t: floaterm
mapcmd('<leader>tt', 'FloatermToggle')
mapcmd('<leader>tn', 'FloatermNew')

-- b: buffer
mapcmd('<leader>bn', 'bn')
mapcmd('<leader>bp', 'bp')
mapcmd('<leader>bd', 'Bdelete')
